package servlet.model;

import java.util.List;

import servlet.bean.CourseBean;
import servlet.bean.TeacherBean;
import servlet.bean.UserBean;
import servlet.dao.DaoFactory;

public class UserInfoManagerService {
	/**

	 * 保存用户信息

	 * 

	 * @param usersB

	 *            用户信息对象

	 * @return 保存结果的记录行数

	 */
	public int saveUserInfo(UserBean usersB) {
		int re_i = 0;
		re_i = DaoFactory.getUserInfoManagerDaoInstance().saveUserInfo(usersB);
		return re_i;
	}
	
	public int saveStuInfo(TeacherBean teaB) {
		int re_i = 0;
		re_i = DaoFactory.getUserInfoManagerDaoInstance().saveStuInfo(teaB);
		return re_i;
	}
	
	public int saveCouInfo(CourseBean couB) {
		int re_i = 0;
		re_i = DaoFactory.getUserInfoManagerDaoInstance().saveCouInfo(couB);
		return re_i;
	}
	
	public int saveStuBatch(TeacherBean teaB) {
		int re_i = 0;
		re_i = DaoFactory.getUserInfoManagerDaoInstance().saveStuBatch(teaB);
		return re_i;
	}
	
	
	public List<UserBean> queryUserInfo(UserBean userB) {
		List<UserBean> lstUser = DaoFactory.getUserInfoManagerDaoInstance().queryUserInfo(userB);
		return lstUser;
	}
	
	
	
	public List<TeacherBean> queryStuInfo(TeacherBean teaB) {
		List<TeacherBean> lstStu = DaoFactory.getUserInfoManagerDaoInstance().queryStuInfo(teaB);
		return lstStu;
	}
	
	public List<TeacherBean> queryStuInfo2(TeacherBean teaB) {
		List<TeacherBean> lstStu = DaoFactory.getUserInfoManagerDaoInstance().queryStuInfo2(teaB);
		return lstStu;
	}
	
	public int deleteUserById(int userId) {
		int re_i = 0;
		re_i = DaoFactory.getUserInfoManagerDaoInstance().deleteUserById(userId);
		return re_i;
	}
	
	public int deleteStuById(int stuId) {
		int re_i = 0;
		re_i = DaoFactory.getUserInfoManagerDaoInstance().deleteStuById(stuId);
		return re_i;
	}
	
	public int deleteCouById(int couId) {
		int re_i = 0;
		re_i = DaoFactory.getUserInfoManagerDaoInstance().deleteCouById(couId);
		return re_i;
	}
	
	public List<UserBean> getAllUsersInfo() {
		List<UserBean> lstUser = DaoFactory.getUserInfoManagerDaoInstance().getAllUserInfo();
		return lstUser;
	}
	
	public List<CourseBean> getCouInfo() {
		List<CourseBean> lstCou = DaoFactory.getUserInfoManagerDaoInstance().getCouInfo();
		return lstCou;
	}
	
	public List<CourseBean> getCou() {
		List<CourseBean> lstCou = DaoFactory.getUserInfoManagerDaoInstance().getCou();
		return lstCou;
	}
	
	public int delCouInfo() {
		int lstCou = DaoFactory.getUserInfoManagerDaoInstance().delCouInfo();
		return lstCou;
	}
	
	public int selectCou(CourseBean couB,String strUid) {
		int re_i =0;
		re_i = DaoFactory.getUserInfoManagerDaoInstance().selectCou(couB,strUid);
		return re_i;
	}
	
	
	
	public List<TeacherBean> getAllStuInfo() {
		List<TeacherBean> lstStu = DaoFactory.getUserInfoManagerDaoInstance().getAllStuInfo();
		return lstStu;
	}
	
	public UserBean getUserInfoById(String strUid) {
		// 使用数据库查询id的信息
		UserBean userB = DaoFactory.getUserInfoManagerDaoInstance().getUserInfoById(strUid);
		return userB;
	}
	
	public TeacherBean getStuInfoById(String strUid) {
		// 使用数据库查询id的信息
		TeacherBean teaB = DaoFactory.getUserInfoManagerDaoInstance().getStuInfoById(strUid);
		return teaB;
	}
	
	public CourseBean getCouInfoById(String strCouid) {
		// 使用数据库查询id的信息
		CourseBean couB = DaoFactory.getUserInfoManagerDaoInstance().getCouInfoById(strCouid);
		return couB;
	}
	
}



